package com.lesama.recursion;

import java.time.LocalDateTime;

public class RecursionDemo2 {
    public static void main(String[] args) {
        // 求斐波那契数列（递归版）
        System.out.println(LocalDateTime.now());
        System.out.println(Fibonacci(44));
        System.out.println(LocalDateTime.now());
    }
    public static int Fibonacci(int num) {
        if(num == 1 || num == 2)    return 1;
        return Fibonacci(num - 1) + Fibonacci(num - 2);
    }
}